package com.sss.hloster0304;
//
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class TestExcel {//List和Map结合

	public static void main(String[] args) {
test01();
	}

	private static void test01() {
		Map<String, Object> p1 = new LinkedHashMap<String,Object>();
		p1.put("Num", "01");
		p1.put("Name", "张三");
		p1.put("Sex", "女");
		p1.put("Age", "30");
		p1.put("Score", "80");
		Map<String,Object> p2 = new LinkedHashMap<String,Object>();
		p2.put("Num", "02");
		p2.put("Name", "李四");
		p2.put("Sex", "男");
		p2.put("Age", "31");
		p2.put("Score", "90");
		Map<String, Object> p3 = new LinkedHashMap<String,Object>();
		p3.put("Num", "03");
		p3.put("Name", "王五");
		p3.put("Sex", "男");
		p3.put("Age", "30");
		p3.put("Score", "70");
		List<Map<String,Object>> list=new ArrayList<>();
		
		list.add(p1);
		list.add(p2);
		list.add(p3);
		System.out.println(p1.keySet()+"      ");
		for(Map<String,Object>p:list) {
			Set<String> keyset=p.keySet();
		
			for(String key:keyset) {
				System.out.print("  "+p.get(key)+"     ");
		}
			System.out.println();
		}
	
		
		for(Map<String,Object>p:list) {
			Set<String> keyset=p.keySet();
			for(Iterator<String> iter=keyset.iterator();iter.hasNext();) {
				String temp=iter.next();
				System.out.print(temp+" : "+p.get(temp)+"  ");
			}
			System.out.println();
		}
	}
}
